<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>物流查询配置</title>
  <link rel="stylesheet" href="{__CSS__}/element_ui.css"/>
  <link rel="stylesheet" href="{__CSS__}/style.css"/>
  <script src="{__JS__}/vue2.js"></script>
  <script src="{__JS__}/element_ui.js"></script>
  <script src="{__JS__}/axios.min.js"></script>
  <script src="{__JS__}/request.js"></script>
</head>
<body>
<div id="app">
  <div class="app-loading" v-if="pageLoading">
    <div class="app-loading__logo">
      <img src="{__IMG__}/logo.png"/>
    </div>
    <div class="app-loading__loader"></div>
    <div class="app-loading__title">{$title}</div>
  </div>
  <el-card class="box-card" v-else>
    <div slot="header" class="clearfix">
      <span>物流查询配置</span>
    </div>

    <el-form ref="form" :model="form" label-width="100px">
      <el-form-item label="AppKey">
        <el-input v-model="form.app_key" style="width: 500px"></el-input>
      </el-form-item>
      <el-form-item label="AppSecret">
        <el-input v-model="form.app_secret" style="width: 500px"></el-input>
      </el-form-item>
      <el-form-item label="AppCode">
        <el-input v-model="form.app_code" style="width: 500px"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="save">立即保存</el-button>
      </el-form-item>
    </el-form>
    <div style="margin-top: 30px;font-size: 13px">* 您可以点击链接前往购买
      <a href="https://market.aliyun.com/products/57126001/cmapi021863.html#sku=yuncode1586300000" target="_blank" style="color: red"> https://market.aliyun.com/products/57126001/cmapi021863.html#sku=yuncode1586300000</a></div>
  </el-card>
</div>

<script>

  let form = {$info|raw};

  new Vue({
    el: '#app',
    data: function () {
      return {
        pageLoading: true,
        form: form,
        baseIndex: '/{:config("shop.backend_index")}/',
      }
    },
    mounted() {
      this.pageLoading = false
    },
    methods: {
      async save() {
        let res = await request.post(this.baseIndex + 'system/express', this.form)
        if (res.code == 0) {
          this.$message.success('保存成功')
        } else {
          this.$message.error(res.msg)
        }
      }
    }
  })
</script>
<style>
  a {text-decoration:none;}
</style>
</body>
</html>